package com.sktlab.bizconfmobile.activity;

import java.util.ArrayList;
import java.util.List;

public class ActivityBuffer {

	List<BaseActivity> activityList;
	
	private static class abHolder{
		
		private static ActivityBuffer instance = new ActivityBuffer();
	}

	public static ActivityBuffer getInstance() {

		return abHolder.instance;
	}

	private ActivityBuffer() {
		
		activityList = new ArrayList<BaseActivity>();
	}

	public void addActivity(BaseActivity basicActivity) {
		activityList.add(basicActivity);
	}

	public void remove(BaseActivity basicActivity) {
		activityList.remove(basicActivity);
	}

	public void clear() {
	
		for(BaseActivity activity : activityList) {
			
			activity.finish();
		}
		
		activityList.clear();
		
		System.gc();
	}

}
